home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _6CE6B26933404CC59ACF078CF4CED8EC < prev    next >
Text File  |  2005-02-13  |  614b  |  30 lines

  1. //wake in water particle shader
  2. //should be used with prtWake2.vsh
  3. //Luke Lenhart
  4. //(C)2004-2005 Digipen Institute of Technology
  5.  
  6. //time since whenever
  7. float time;
  8.  
  9. //
  10. struct PS_INPUT
  11. {
  12.     float2 Side : TEXCOORD0; //side of particle model is on (-1 to 1) (.xy)
  13.     float4 Clr : COLOR;
  14. };
  15.  
  16. float4 PShader(PS_INPUT In) : COLOR
  17. {
  18.     //calc wave alpha
  19.     float alpha=sin(In.Side.x*23+time) + sin(In.Side.y*11+sin(In.Side.x*13+time))*.5f;
  20.  
  21.     //fade towards edges
  22.     alpha*=sqrt(saturate(1.0f-distance(float2(0,0),In.Side.xy)));
  23.     
  24.     //make final color
  25.     float4 clr=In.Clr;
  26.     clr.a*=alpha;
  27.     
  28.     return clr;
  29. }
  30.